<?php



namespace app\api\validate;


use \think\Validate;

/**
 *  找回密码原则类
 */
class Retrieve extends Validate
{
    protected $rule = [
        'email' => 'require|email',
        'code' => 'require|length:6',
        'password' => 'require|length:16,32',
        'repeat_password' => 'require|length:16,32'
    ];

    //定义验证提示
    protected $message = [
        'email.require' => 'retrieve.emailCannotBeEmpty',
        'email.email' => 'retrieve.emailFormatError',
        'code.require' => 'retrieve.codeRequire',
        'code.length' => 'retrieve.codeLength',
        'password.require' => 'retrieve.passwordRequire',
        'password.length' => 'retrieve.passwordLengths',
        'repeat_password.require' => 'retrieve.repeatPasswordRequire',
        'repeat_password.length' => 'retrieve.repeatPasswordLengths',
    ];

    //定义验证场景
    protected $scene = [
        'verify' => ['email','code'],
        'getEmailCode' => ['email'],
        'password' => ['email','code','password'],
    ];

}
